package com.qst.rongxiaotong.service.serviceImpl;

import com.qst.rongxiaotong.context.BaseContext;
import com.qst.rongxiaotong.mapper.SellPurchaseMapper;
import com.qst.rongxiaotong.pojo.MyPurchase;
import com.qst.rongxiaotong.pojo.SellPurchase;
import com.qst.rongxiaotong.service.SellPurchaseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SellPurchaseServiceImpl implements SellPurchaseService {
    @Autowired
    SellPurchaseMapper sellPurchaseMapper;
    @Override
    public void add(SellPurchase sellPurchase) {
        sellPurchaseMapper.add(sellPurchase);
    }

    @Override
    public List<MyPurchase> selectSells() {
        String name = BaseContext.getCurrentuserName();
        List<MyPurchase> purchases = sellPurchaseMapper.purchases(name);
        return purchases;
    }
}
